<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 对象, 怎么来的
        // 1. json 字面量
        // let o = {
        //     name: '石兴龙'
        // }

        // 2. new
        // function Person(name) {
        //     this.name = name || '石兴龙'
        // }
        // let o = new Person('张三');
        // 

        // 3. Object.create()
        // let o = Object.create({
        //     name: '石兴龙'
        // })
        // console.log(o)

        // delete: 删除对象的 key
        let o = {
            name: '石兴龙',
            age: 18,
            get length() {
                console.log('111222')
                return new Date()
            },
            set length(v) {
                console.log('set lenght, ', v)
            },
        }
        
        // o.length = '321'

        // in: 检查属性是否属于某个对象
        console.log(
            'length__1' in o
        )

        console.log(o)
        console.log(o.length)
    </script>
</body>
</html>
